﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.tjtt.tdm.system.action.ShowTree" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
    <base href="<%=basePath%>">

    <title>试验数据管理系统</title> 
	<link rel="stylesheet" type="text/css" href="<%=path %>/jslib/jquery-easyui-1.4.1/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=path %>/jslib/jquery-easyui-1.4.1/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="<%=path %>/jslib/jquery-easyui-1.4.1/demo/demo.css">
	<script type="text/javascript" src="<%=path %>/jslib/jquery-easyui-1.4.1/jquery.min.js"></script>
	<script type="text/javascript" src="<%=path %>/jslib/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="<%=path %>/jslib/jquery-easyui-1.4.1/locale/easyui-lang-zh_CN.js"></script>
	<script src="<%=path %>/web/js/jquery-1.8.2.min.js" type="text/javascript"></script>
	<script src="<%=path %>/web/js/jquery.fancybox.pack.js" type="text/javascript"></script>
	<script type="text/javascript" src="<%=path%>/jslib/lhgdialog/lhgcore.lhgdialog.min.js?skin=mac"></script>
	<script src="<%=path %>/web/js/function.js" type="text/javascript"></script>
	<link href="<%=path %>/web/style/layout.css" rel="stylesheet" type="text/css" /> 
    <script type="text/javascript" src="<%=path %>/jslib/yanue.pop.js"></script>
    
	
	
	<style>
           body{background-repeat:repeat-x;background-color:#eaeaea; }
    </style>
    <script type="text/javascript">
    	$(document).ready( function(){
    		//此post查询一般流程状态数量
    		
    		$.ajax({
				type: "POST",
				async: true,//取消异步提交
				url: 'system/tips!getSysTips.action',
				dataType: "text",
				success : function(data, textStatus) { 
					if(data!='error' && data!=""){
						var pop=new Pop(data);
					}
				}
			});
			
			getInitCountlv();
    	}); 

	</script>
	
<script language="javascript">
//显示时间  
function showClock(){  
	var strDate ;
	today=new Date();
	var n_day = today.getDay();
	switch (n_day)
	{
	    case 0:{
	      strDate = "星期日"
	    }break;
	    case 1:{
	      strDate = "星期一"
	    }break;
	    case 2:{
	      strDate ="星期二"
	    }break;
	    case 3:{
	      strDate = "星期三"
	    }break;
	    case 4:{
	      strDate = "星期四"
	    }break;
	    case 5:{
	      strDate = "星期五"
	    }break;
	    case 6:{
	      strDate = "星期六"
	    }break;
	    case 7:{
	      strDate = "星期日"
	    }break;
	}
    var time = new Date(); //获取当前时间  
    var year = time.getFullYear(); //获取当前年份  
    var month = time.getMonth() + 1; //获取当前月份(getMonth()的取值范围为0~11)  
    var date = time.getDate(); //获取当前日期  
    var hour = time.getHours(); //获取当前小时数  
    var minute = time.getMinutes(); //获取当前分钟数  
    var second = time.getSeconds(); //获取当前秒数  
    var millisecond = time.getMilliseconds(); //获取毫秒数  
    month = checkTime(month); //检查月份，若为个位数前面补零  
    date = checkTime(date); //检查日期，若为个位数前面补零  
    minute = checkTime(minute); //检查分钟数，若为个位数前面补零  
    second = checkTime(second); //检查秒数，若为个位数，前面补零  
    ap = checkNoon(hour); // 检查时am还是pm  
    //document.getElementById('time').innerHTML = "今天是&nbsp;" + year + "年" + month + "月" + date + "日&nbsp;" + hour + ":" + minute + ":" + second + "&nbsp;&nbsp;" + strDate ; //显示时间
    //setTimeout("showClock()",100);  
}  
//对时间是一位数的进行前面补零  
function checkTime(i)  
{  
    if (i < 10) {  
        i = "0" + i;  
    }  
    return i;  
}  
//判断是上午还是下午  
function checkNoon(h){  
    if(h < 12){  
        ap = "am";//上午  
    }  
    else{  
        ap = "pm";//下午  
    }  
    return ap;  
}  
function refreshCountlv(para,state){
		changeRight(para);
		getInitCountlv();
}
function changeRight(url){
   jQuery("#mainframe").attr("src",url);
   window.scrollTo(50,50); 
<%--			    jQuery.get(url, function(result){  --%>
<%--			        jQuery("#contentside").html(result);  --%>
<%--			    });  --%>
}
function getInitCountlv(){
			//此post查询一般流程状态数量
    		$.ajax({
				type: "POST",
				async: false,//取消异步提交
				url: 'workflowAction!queryFlowtaskType.action?type=0',
				dataType: "json",
				success : function(data, textStatus) {  
					if(data.ajaxResult=='success'){
						$("#daibanrws").html(data.taskCount);
					}else{
						$("#daibanrws").html("0");
					}
				}
			});
			//此post查询加急流程状态数量
			$.ajax({
				type: "POST",
				async: false,//取消异步提交
				url: 'workflowAction!queryFlowtaskType.action?type=1',
				dataType: "json",
				success : function(data, textStatus) {  
					if(data.ajaxResult=='success'){
						$("#daiqianrws").html(data.taskCount);
					}else{
						$("#daiqianrws").html("0");
					}
				}
			});
			//此post查询延期流程状态数量
			$.ajax({
				type: "POST",
				async: false,//取消异步提交
				url: 'workflowAction!queryFlowtaskType.action?type=2',
				dataType: "json",
				success : function(data, textStatus) {  
					if(data.ajaxResult=='success'){
						$("#tuihuirws").html(data.taskCount);
					}else{
						$("#tuihuirws").html("0");
					}
				}
			});
}

 function downloadfile(name){
    window.location.href="<%=request.getContextPath()%>/codeReviewActionNew!downloafAnnex.action?flag=2&fileName="+name;
 }
 
 function clickrow(row){  
 	if (row.attributes!=undefined){
 		changeRight(row.attributes.url,row.text)
 	}
 }
</script>
  </head>
  
  <body id="homepage" style="background:url(<%=path %>/web/images/bg_body_left.png); background-repeat:repeat-y; background-position:left;background-color:#eaeaea;">
	<input type="hidden" id="hundoWork1" name="hundoWork1" />
	<input type="hidden" id="undoWork1" name="undoWork1" />
	<input type="hidden" id="backWork1" name="backWork1" />
	<input type="hidden" id="undoDaiqian1" name="undoDaiqian1" />

<script type="text/javascript" >
	  //记得加载jquery
	  //作者：yanue
	  //使用参数：1.标题，2.链接地址，3.内容简介
	 
</script>

	<!--jquery右下角pop弹窗start -->
<div id="pop" style="display:none;">
	<style type="text/css">
	*{margin:0;padding:0;}
	#pop{background:#fff;width:260px;border:1px solid #e0e0e0;font-size:12px;position: fixed;right:5px;bottom:5px;}
	#popHead{line-height:25px;background:#9E9E9E;border-bottom:1px solid #e0e0e0;position:relative;font-size:12px;padding:0 0 0 10px;}
	#popHead h2{font-size:12px;color:#666;line-height:32px;height:32px;}
	#popHead #popClose{position:absolute;right:10px;top:1px;color: #fff;}
	#popHead a#popClose:hover{color:#f00;cursor:pointer;}
	#popContent{padding:5px 10px;}
	#popTitle a{line-height:24px;font-size:14px;font-family:'微软雅黑';color:#333;font-weight:bold;text-decoration:none;}
	#popTitle a:hover{color:#f60;}
	#popIntro{text-indent:24px;line-height:160%;margin:5px 0;color:#666;}
	#popMore{text-align:right;border-top:1px dotted #ccc;line-height:10px;margin:8px 0 0 0;}
	#popMore a{color:#f60;}
	#popMore a:hover{color:#f00;}
	</style>
	<div id="popHead">
	<a id="popClose" title="关闭">关闭</a>
	<h3 style="color: #fff">系统提示</h3>
	</div>
	<div id="popContent">
		<span id="popIntro"></span>
		<p id="popMore">&nbsp;</p>
	</div>
</div>
<!--右下角pop弹窗 end-->
<div class="header">
  <div class="header_img">
   <div style="margin:0 0px;">
	    <div class="logo">
	    	<img src="web/images/logo.png" />
	    </div>
	</div>
  <div id="systemmenu">
    <p class="left smltxt">
    <DIV style="margin-top:15px;">
    <a href="web/main.jsp"><img src="web/images/top_icon1.png" border="0" title="首页" /></a> 
    <img src="web/images/top_icon2.png" border="0" title="系统公告" onclick="refreshCount('system/MessageListView.jsp?type=0')" style="cursor: pointer"/>
    <img src="web/images/top_icon3.png" border="0" title="站内短消息" onclick="refreshCount('system/MessageListView.jsp?type=1')" style="cursor: pointer"/>
    <img src="web/images/top_icon4.png" border="0" title="帮助"  onclick="refreshCount('help.doc')" style="cursor: pointer"/>
    <img src="web/images/top_icon6.png" border="0" title="下载控件" onclick="downloadfile('NtkoOfficeControlSetup.msi')" style="cursor: pointer"/>
    <img src="web/images/top_icon5.png"  onclick="logout()" style="cursor: pointer" border="0" title="退出" />
    </DIV>
    </p>
  </div>
  </div>
</div>
<div id="position">
  <ul>
    <li onclick="toggleMenu()" >
      <div id="toggle_menu" class="toggle_open"  title="关闭左侧菜单"></div>
    </li>
    <li>位置：</li>
    <li><span class="index">首页</span></li>
    <li>/</li>
    <li class="current">欢迎页面</li>
    <li style="width: 70%;">
      <div style="float: right;"><span id="time"></span></div>
    </li>
  </ul>
</div>
<div id="rightside">
  <div id="contentside">
  	<iframe scrolling="no" src="portletAction!newPortlet.action" width="100%" height="700px" frameborder="0" id="mainframe" onLoad="iFrameHeight()"> </iframe>
  </div>
  <div id="contentdetail" style="display: none;"></div>
  <div style="clear: both;"></div>
  <div class="footer"> <span class="copyright">Copyright 西安昆仑工业(集团)有限责任公司&copy; .All Rights Reserved.&nbsp;&nbsp;技术支持：金航数码科技有限责任公司</span> <span class="sy_logo"><img src="web/images/shenying_logo.gif" /></span> </div>
</div>
<div id="leftside">
  <div class="user"> <img id="avatar" src="<%=request.getContextPath()%>/printImage.action?path=${sessionScope.HEADER}" onerror="this.onerror=null;this.src='web/images/avatar.png';" width="48" height="48" class="hoverimg" />
    <p>欢迎登录：<br />
    </p>
    <p class="username"><%=session.getAttribute("username") %></p>
    <div class="message" >
    	<!-- flag=1表示正常 flag=2表示退回 -->
       <ul>
         <li title="代办任务数"><img src="images/green.gif" alt="代办任务数" /><span id="daibanrws"  style="cursor:pointer;color:red;" onclick="refreshCountlv('workflow/haslaunched_worklist.jsp?flag=1','')"></span>
         <li title="待签任务数"><img src="images/star.png"  alt="待签任务数" /><span id="daiqianrws" style="cursor:pointer;color:red;" onclick="refreshCountlv('workflow/daiqianlist.jsp','')"></span>
         <li title="退回任务数"><img src="images/red.gif"   alt="退回任务数" /><span id="tuihuirws"  style="cursor:pointer;color:red;" onclick="refreshCountlv('workflow/haslaunched_worklist.jsp?flag=2','')"></span>    
      </ul>
    </div>
    <div style="float:left">
      <p class="userbtn"><a title=""><span  onclick="changeRight('system/updatePwd.jsp')" style="cursor: pointer">修改密码</span></a></p>
      <p class="userbtn"><a title=""><span  onclick="refreshCount('system/MessageListView.jsp?type=0')" style="cursor: pointer;">查看公告</span></a></p>
      <p class="userbtn"><a title=""><span  onclick="logout()" style="cursor: pointer" title="">退出</span></a></p>
    </div> 
  </div>
  <ul id="menu">
    <div style='color:#fff;'>
    	<ul id="tt" class="easyui-tree" data-options="
			url:'${pageContext.request.contextPath}/menu!queryMenuTreeClose.action',
			animate:true,
			lines:true,
			dnd:true,
			onClick:clickrow"></ul>
    </div>
  </ul>
</div>
<div id="ajax-loader" style="display:none;position:fixed;right:0;bottom:0;"><img src="web/images/loading.gif" alt="loading" /></div>
<div id="dialog"></div>
<script language="javascript"> showClock();</script>
<script>
		function iFrameHeight() { 
			var ifm= document.getElementById("mainframe"); 
			var subWeb = document.frames ? document.frames["mainframe"].document : ifm.contentDocument; 
			if(ifm != null && subWeb != null) { 
				var hh = subWeb.body.scrollHeight+30; 
				if(hh<600){
					ifm.height = 600; 
				}else{
					ifm.height = subWeb.body.scrollHeight+30; 
				}
			} 
		} 
        var deskStr = '<div style=" text-align:center;"><img src="web/images/subbg.png" width="650" /></div>';
        function setMyDesk() {
            jQuery("#contentside").html(deskStr);
            setPosition("欢迎页面");
        }
        function openDialog(URL) {
            window.open(URL, "Map", "location=0,width=" + jQuery(document).width() + ",height=" + jQuery(document).height() + ",left=0,top=0,menubar=0,center=1,help=0,scroll=0,toolbar=0,resizable=1,status=0");
        }
        function toggleMenu() {
            var speed = 500;
            if (jQuery("#leftside").is(':visible')) {
                jQuery("#rightside").animate({ "margin-left": "20px" }, speed);
                jQuery("#position").animate({ "margin-left": "0px" }, speed);
                jQuery("body").css("background", "#EAEAEA");
                jQuery("#leftside").animate({ width: "0px" }, speed, "", function () { jQuery(this).hide() });
                jQuery("#toggle_menu").removeClass().addClass("toggle_close").attr("title", "打开左侧菜单");
            } else {
                jQuery("#rightside").animate({ "margin-left": "250px" }, speed);
                jQuery("#position").animate({ "margin-left": "225px" }, speed);
                jQuery("#leftside").show().animate({ width: "225px" }, speed, "", function () { jQuery("body").css("background", "#EAEAEA url(weborange/images/bg_body_left.png) repeat-y left") });
                jQuery("#toggle_menu").removeClass().addClass("toggle_open").attr("title", "关闭左侧菜单");
            }
        }
        function changeRight(url,menuname){
            //自定义表单添加、修改、查看需要加上菜单名称
            if(url.indexOf("?")>-1){
                url = url +"&menuname="+encodeURIComponent(encodeURIComponent(menuname));
            }else{
                url = url +"?menuname="+encodeURIComponent(encodeURIComponent(menuname));
            }
            jQuery("#mainframe").attr("src",url);
            window.scrollTo(0,0); 
        }
        function refreshCount(para,state){
    		changeRight(para);
    		getInitCount(state);
    	}

    </script>
</body>
</html>
